package me.firstapp.manage.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import me.firstapp.manage.common.BaseManage;
import me.firstapp.module.weixin.system.ThisSystem;
import me.firstapp.service.weixin.system.ThisSystemService;

@Controller
@RequestMapping(value = "/systemManage")
public class SystemManagePage extends BaseManage {

	@Autowired
	private ThisSystemService thisSystemService;

	@RequestMapping(value = "/systemParamList.html", method = RequestMethod.GET)
	public ModelAndView systemParamListView(HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		return new ModelAndView("system/systemParam", modelMap);
	}

	@RequestMapping(value = "/systemParamUpdate.html", method = RequestMethod.GET)
	public ModelAndView systemParamUpdateView(Long id, HttpServletRequest request, HttpServletResponse response,
			ModelMap modelMap) {
		ThisSystem thisSystem = thisSystemService.findThisSystemById(id);
		modelMap.put("thisSystem", thisSystem);
		modelMap.put("id", thisSystem.getId());
		return new ModelAndView("system/systemParamUpdate", modelMap);
	}
}
